import React from 'react'

const About = () => 
{

  //钩子函数初始化路由跳转对象
  const navigate = React.$Router.useNavigate()

  const [about, SetAbout] = React.useState({})

  const back = () => {
    navigate(-1)
  }

  const AboutData = async () =>
  {
    var result = await React.$Api.HomeAbout()

    SetAbout(result.data)

    console.log(result.data)
  }

  React.useEffect(() => {
    AboutData()
  }, [])

  const Content = () =>
  {
    if(about.about)
    {
      return (
        <div dangerouslySetInnerHTML={{__html:about.about.description}}></div>
      )
    }
  }

  return (
    <>
      {/* 导航栏 */}
      <React.$Vant.Sticky>
        <React.$Vant.NavBar
          title="关于我们"
          onClickLeft={back}
          zIndex="10"
        />
      </React.$Vant.Sticky>

      <div className="jianjie_k">
          <h2>{about.SiteName}</h2>
          <p style={{textAlign:'center'}}>官方客服电话：{about.SiteTel}</p>
          {Content()}
      </div>
      <div className="footer_jianj">
          <p>{about.SiteBeian}</p>
      </div>
    </>
  )
}

export default About